// 引入发送请求的方法
import request from '@/utils/request'

// 封装一个发送请求的api
export function getDepartments() {
  return request({
    method: 'get',
    url: '/company/department'

  })
}

export function addDepartments(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

export function getDepartDetail(id) {
  return request({
    method: 'get',
    url: '/company/department/' + id
  })
}

export function updateDepartments(data) {
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}

export function delDepartments(id) {
  return request({
    method: 'delete',
    url: '/company/department/' + id
  })
}

